module Admin::GameConfigHelper
  
  def game_header_image_html(game_config, alt="", title="", no_image_text="")
    html = no_image_text
    if game_config.header_image.exists?
      html = image_tag(game_config.header_image.url, {:alt=>alt, :title=>title})
    end
    html
  end
  
  
  def game_background_image_html(game_config, alt="", title="", style=:medium, no_image_text="")
    html = no_image_text
    if game_config.background_image.exists?
      html = image_tag(game_config.background_image.url(style), {:alt=>alt, :title=>title})
    end
    html    
  end
  
  def game_image_html(game_config, alt="", title="", style=:medium)
    html = ""#image_tag(WEBAPP_CONFIG["default_game_image"],{:alt=>alt, :title=>title})
    if game_config.game_image.exists?
      html = image_tag(game_config.game_image.url(style), {:alt=>alt, :title=>title})
    end
    html    
  end
  def game_config_image_url(game_config, style)
    url = ""#image_path(WEBAPP_CONFIG["default_game_image"])
    if game_config.game_image.exists?
      url = game_config.game_image.url(style)
    end
    url
    
  end
  def game_config_welcome_line(gamer_name="")
    GameConfig.game_config.welcome_line.gsub("{actor}","<strong>"+gamer_name+"</strong>")
    
  end
  
end
